package com.xyht.medicine_management_system.modules.kuaidi.myEnum;

public enum KuaidiCompanyEnum {
    SF("shunfeng", "顺丰快递"),
    ZTO("zhongtong", "中通快递"),
    STO("shentong", "申通快递"),
    YTO("yuantong", "圆通速递"),
    YUNDA("yunda", "韵达快递"),
    EMS("ems", "EMS快递"),
    JT("jtexpress", "极兔快递"),
    ZJS("zhaijisong", "宅急送"),
    DB("debangkuaidi", "德邦快递"),
    jd("jd", "京东快递");
    private String companyPinYin;
    private String companyName;

    public String getCompanyPinYin() {
        return companyPinYin;
    }

    public String getCompanyName() {
        return companyName;
    }

    KuaidiCompanyEnum(String companyPinYin, String companyName) {
        this.companyPinYin = companyPinYin;
        this.companyName = companyName;
    }

    public static KuaidiCompanyEnum fromCode(String code) {
        for (KuaidiCompanyEnum status : values()) {
            if (status.getCompanyPinYin().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid order status code: " + code);
    }
}
